import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);
import Layout from "@/views/layout";
const routes = [
  {
    path: "/",
    component: Layout,
    children: [
      {
        path: "",
        component: () => import("@/views/home"),
      },
      {
        path: "/category/:id",
        component: () => import("@/views/category"),
      },
      {
        path: "/category/sub/:id",
        component: () => import("@/views/category/sub"),
      },
    ],
  },
  {
    path: "/login",
    component: () => import("@/views/login"),
  },
];

const router = new VueRouter({
  routes,
});

export default router;
